package com.example.hotelrear.controller;

import com.example.hotelrear.entity.ResponseResult;
import com.example.hotelrear.entity.Room;
import com.example.hotelrear.service.RoomService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author FengXiao
 * @since 2023-08-28
 */
@RestController
@RequestMapping("/room")
public class RoomController {
    @Resource
    private RoomService roomService;

    @GetMapping("/findAllRoom")
    public ResponseResult findAllRoom() {
        List<Room> roomList= roomService.findAllRoom();
            return ResponseResult.ok(roomList);
        }

}
